﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eShop.Model
{
    public class CartItemCollection : List<CartItem>
    {
        public double TotalWeight
        {
            get
            {
                double totalWeight = 0;
                this.ForEach(item => totalWeight += item.TotalWeight);
                return totalWeight;
            }
        }
        public double SubTotal
        {
            get
            {
                double subTotal = 0;
                this.ForEach(item => subTotal += item.TotalPrice);
                return subTotal;
            }
        }
        public int TotalCartItem
        {
            get
            {
                int totalCartItem = 0;
                this.ForEach(item => totalCartItem += item.Quantity);
                return totalCartItem;
            }
        }
    }
}
